package com.jungle.base.controller;

import com.jungle.base.service.IChatService;
import com.jungle.framework.chat.ChatExecuteRes;
import com.jungle.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Chat相关接口
 */
@RestController
@Slf4j
@RequiredArgsConstructor
@RequestMapping("/smart/chat")
public class JChatController {

    private final IChatService service;
    /**
     * 聊天接口
     * @param message
     * @return
     */
    @PostMapping("/completions")
    public R<ChatExecuteRes> chatCompletions(String message){
        return R.ok(service.chatCompletions(message));
    }
}
